<?php
trait Staticmethod
{
    public static function doSomething()
    {
        echo "Doingthong  ";
    }
}
class myClass{
    use Staticmethod;
    function func(){
        echo"ok";
        self::doSomething();
    }
}
myClass::doSomething();

(new myClass)->func();